<?php 

/* Copyright 2010 John Hooley

	  
    This file is part of Portfolio Zen.



    Portfolio Zen is free software: you can redistribute it and/or modify

    it under the terms of the GNU General Public License as published by

    the Free Software Foundation, either version 3 of the License, or

    (at your option) any later version.



    Portfolio Zen is distributed in the hope that it will be useful,

    but WITHOUT ANY WARRANTY; without even the implied warranty of

    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

    GNU General Public License for more details.



    You should have received a copy of the GNU General Public License

    along with Portfolio Zen.  If not, see <http://www.gnu.org/licenses/>.

 */ 



defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.controller');

class PortfoliozenController extends JController {

  public function __construct(){
    parent::__construct();
    $this->registerTask('loadGallery', 'loadGallery');   
  }

  public function display(){
    JRequest::setVar('view', 'galleries');
    parent::display();
  }

  public function loadGallery(){
    $id = JRequest::getInt('id', false);
    $type = JRequest::getCmd('type', 'gallery');
    $gallery = 'Bad Request';
    if($id){
      $model =& $this->getModel('gallery');
      $gallery = $model->load($id, $type);
    }
    echo $gallery;
  }

}